#!/bin/bash
source ../common/common.sh

echo "===INIT==UBUNTU=UTILS==="
sudo echo "SUDO ROOT"

show t "安装expect"
install_apt_pack "force|expect"

show t "安装openvpn"
install_apt_pack "force|network-manager-openvpn"

show t "安装proxychains sshpass"
install_apt_pack "force|proxychains sshpass"
if [ -f /etc/proxychains.conf ]; then
  find_replace_line /etc/proxychains.conf "socks4 	127.0.0.1 9050" "socks5  127.0.0.1 7070" "1"
fi

show t "安装jq"
install_apt_pack "force|jq"

show t "安装htop saidar glances nmon"
install_apt_pack "force|htop saidar glances nmon"

show t "安装figlet toilet"
install_apt_pack "force|figlet toilet"

show t "安装uni2ascii ascii2binary"
install_apt_pack "force|uni2ascii ascii2binary"

if [ `is_desktop` -eq 1 ]; then
  show t "安装截图软件"
  install_apt_pack "ppa:dhor/myway|update|force|hotshots shutter scrot"

  show t "安装astyle retext软件"
  install_apt_pack "force|astyle retext"
fi

if [ `is_desktop` -eq 1 ]; then
  show t "安装classicmenu-indicator"
  install_apt_pack "ppa:diesch/testing|update|force|classicmenu-indicator" 
  show t "安装gstm"
  install_apt_pack "force|gstm"
fi

if [ `is_desktop` -eq 1 ]; then
  show t "安装Beyond Compare 3"
  tmpdir=/works/downloads/utils
  tmpfile=$tmpdir/bcompare-3.3.10.17762_i386.deb
  tmpurl=http://www.scootersoftware.com/bcompare-3.3.10.17762_i386.deb
  
  chk_mkdir $tmpdir
  chk_downfile $tmpurl $tmpfile yes
  if [ -f $tmpfile -a `find_dpkg bcompare` != "1" ]; then
    install_apt_pack "force|libxft2:i386"
    sudo dpkg -i $tmpfile
    sudo apt-get -y -f install
  fi
  echo "注册码:"
  echo "  HmB5oANygQOhaStTHNa+zOKgOeWHOkeAp6d1+QwIebz6z9kwYCm9-O0jF9F79zvzed9v5UVC4VrDkDMmTM8nB+"
fi

